<!DOCTYPE html>
<html lang="en">
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Document</title>
  <link rel="stylesheet" href="./style.css" type="text/css" />
  <body>
    <div class="wrapper">
      <div class="carousel"></div>
    </div>
    <script>
      emojis = [
        ["🐳", "spouting whale", "U+1F433"],
        ["🐋", "whale", "U+1F40B"],
        ["🐬", "dolphin", "U+1F42C"],
        ["🐟", "fish", "U+1F41F"],
        ["🐠", "tropical fish", "U+1F420"],
        ["🐡", "blowfish", "U+1F421"],
        ["🦈", "shark", "U+1F988"],
        ["🐙", "octopus", "U+1F419"],
        ["🐚", "spiral shell", "U+1F41A	"],
      ];

      const carousel = document.querySelector(".carousel");
      const frag = document.createDocumentFragment();

      for (let i = 0; i < emojis.length; i++) {
        const d1 = document.createElement("div");
        d1.className = "carousel_item";
        const inn = document.createElement("div");
        inn.className = "carousel_item-head";
        inn.textContent = emojis[i][0];
        const inner = document.createElement("div");
        inner.className = "carousel_item-body";
        const p1 = document.createElement("p");
        p1.className = "title";
        p1.textContent = emojis[i][1];
        const p2 = document.createElement("p");
        p2.textContent = `Unicode：${emojis[i][2]}`;
        inner.appendChild(p1);
        inner.appendChild(p2);
        d1.appendChild(inn);
        d1.appendChild(inner);
        frag.appendChild(d1);
      }
      carousel.appendChild(frag);
    </script>
  </body>
</html>
